package com.gopay.common.constants.fund;

/**
 * 基金支付订单结算状态 : "20","待结算" ; "21","代付款审核" ; "22","代付款确认"; "23","付款进行中" ; "24","付款成功"; "25","付款失败"; "26","已结算";"27","待银行确认";
 * @author jianghp
 *
 */
public enum FundSettleStatusEnum {

	/**
	 * 待结算
	 */
	NEED_SETTLE("20","待结算"),
	/**
	 * 代付款审核
	 */
	PAY_CHECK("21","待付款审核"),
	/**
	 * 代付款确认
	 */
	PAY_CONFIRM("22","待付款确认"),

	/**
	 * 付款进行中
	 */
	PAY_LOADING("23","付款进行中"),
	/**
	 * 付款成功
	 */
	PAY_SUCCESS("24","付款成功"),

	/**
	 * 线上付款
	 */
//	PAY_SUCCESS_ONLINE("241","付款成功_线上付款"),

	/**
	 * 线下付款
	 */
//	PAY_SUCCESS_OFFLINE("242","付款成功_线下付款"),
	/**
	 * 付款失败
	 */
	PAY_FAILURE("25","付款失败"),

	/**
	 * 已结算
	 */
	SUCCESS_SETTLE("26","已结算"),

	/**
	 * 待银行确认
	 */
	WAIT_BANK_AGREE("27","待银行确认"),

	/**
	 * 已退款
	 */
	REFUNDED("28","已退款"),

	/**
	 * 重发付款进行中
	 */
	REDO_PAY_LOADING("29","重发付款中"),

	//标记02014和02015校验异常
	PAY_LOADING_CHECK_ERROR("01","赎回付款进行中:校验未通过"),
	//标记02014和02015订单发往acps未知异常
	PAY_LOADING_NO_RESULT("02","赎回付款进行中:状态未知"),
	//标记正常状态
	PAY_LOADING_NOMAL("00","赎回付款进行中:状态正常");

	public String value;
	public String des;


	FundSettleStatusEnum(String value, String des){
		this.value = value;
		this.des = des;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

	/**
	 * 通过编码获取值
	 * @author yhwpeng@126.com
	 * @date 2017-12-27 16:07:42
	 * @params
	 * @param code : 订单状态值
	 * @return java.lang.String
	 */
	public static String getDescByCode(String code){
		for (FundSettleStatusEnum statusEnum : FundSettleStatusEnum.values()) {
			if (code.equals(statusEnum.getValue())){
				return statusEnum.getDes();
			}
		}
		return "";
	}
}
